<template>
	<view class="group-list">
		<view class="list">
			<view style="font-size: 50rpx;align-content: center;">
				正在参与拼团活动
			</view>
			<view class="item acea-row row-between-wrapper" style="display: flex;" v-for="(item,index) in joinPink" :key='index' >
				<view class="pictrue">
					<image style="width: 300rpx;height: 200rpx;" class="" :src="item.goods_img">
					</image>
				</view>
				
				<view class="text" >
					<view>已有1人参团，仅差3x人</view>
					<view>{{item.end_time}}后结束</view>
					<view class="go" style="margin-top: 50rpx;font-size: 50rpx;" @tap="goInPink(item.pink_no)">查看详情</view>
				</view>
			</view>
		</view>
		<view style="font-size: 50rpx;align-content: center;">
			拼团活动列表
		</view>
		<view class="list">
			<view class="item acea-row row-between-wrapper" v-for="(item,index) in pinkList" :key='index' @tap="goPink(item.id)">
				<view class="pictrue">
					<image :src="item.goods_img"></image>
				</view>
				<view class="text">
					<view class="name line2">{{item.pink_name}}</view>
					<view class="bottom acea-row row-between row-bottom">
						<view class="y_money">
							<view class="price">￥{{item.goods_sku_price}}</view>
							<view class="money">￥<text class="num">{{item.pink_price}}</text></view>
						</view>
						<view style="display: flex;" class="bnt acea-row row-center-wrapper" v-if="item.pink_sku_stock>0&&item.total_num>0">
							<view class="light">
								<image src=""></image>
							</view>
							<view class="num">{{item.pink_people}}人团</view>
							<view class="go">去拼团</view>
						</view>
						<view class="bnt gray acea-row row-center-wrapper" v-else>已售罄</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pinkList:[],
				limit: 10,
				page: 1,
				joinPink:[],
			};
		},
		onLoad() {
			this.getInPink();
			this.getList();
		},
		methods: {
			getList(){
				this.$http.get('pink/list', {
					//传递参数
				}, {}).then(res => {
					this.pinkList = res.data.data.data
				});
			},
			goPink:(pinkId)=>{
				uni.navigateTo({
					url:"/pages/Activity/PinkGoodsDetails/PinkGoodsDetails?pinkId="+pinkId,
				})
			},
			getInPink(){
				this.$http.get('pink/join', {
				}, {}).then(res => {
					this.joinPink = res.data.data
					let end_time = res.data.data.end_time;
				});
			},
			goInPink(pinkNo){
				uni.navigateTo({
					url:'/pages/Activity/PinkGoodsStatus/PinkGoodsStatus?pinkNo='+pinkNo
				})
			}
		},
	}
</script>

<style  lang="scss">
	@import 'PinkList.scss';
</style>
